Skip to content

[AI-FSSDK] [FSSDK-12369] Add local holdouts support to JavaScript SDK#1151

Merged
raju-opti merged 4 commits into
masterfrom
ai/mat001/FSSDK-12369-local-holdouts
Jun 1, 2026
Merged

[AI-FSSDK] [FSSDK-12369] Add local holdouts support to JavaScript SDK#1151
raju-opti merged 4 commits into
masterfrom
ai/mat001/FSSDK-12369-local-holdouts

Conversation

@Mat001
Copy link
Copy Markdown
Contributor

@Mat001 Mat001 commented May 14, 2026

Summary

Adds Local Holdouts support to the JavaScript SDK. Local holdouts allow targeting specific experiment or delivery rules within a flag, while global holdouts (the existing behavior) apply to all rules across all flags. This introduces a new rule-level targeting system using an includedRules field on the holdout data model.

Changes

  • Added includedRules and isGlobal fields to the Holdout interface in shared_types.ts
  • Added HoldoutConfig interface and getGlobalHoldouts / getHoldoutsForRule helper functions to project_config.ts; parseHoldoutsConfig now builds and stores these lookups during config initialization
  • Updated decision_service/index.ts to evaluate global holdouts via getGlobalHoldouts() at flag level and check local holdouts per-rule (after forced decisions, before regular rule evaluation) for both experiment rules and delivery rules
  • Added Level 1 unit tests for config/parsing (isGlobal classification, backward compat, edge cases) and Level 2 decision service tests (one per branch of the local holdout pseudocode)

Jira Ticket

FSSDK-12369

@coveralls
Copy link
Copy Markdown

coveralls commented May 14, 2026

Coverage Status

coverage: 77.761% (-0.1%) from 77.906% — ai/mat001/FSSDK-12369-local-holdouts into master

@Mat001 Mat001 requested a review from raju-opti May 18, 2026 17:14
Copy link
Copy Markdown
Contributor

@raju-opti raju-opti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to refactor few thing. But good for now

Comment thread lib/core/decision_service/index.ts Outdated
* When present, the caller should use this as the full decision result
* instead of constructing one from the experiment.
*/
localHoldoutDecision?: DecisionObj;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field does not make sense inside this type. This will work functionally now, but I would like to refactor it later

Comment thread lib/core/decision_service/index.spec.ts Outdated

// Level 2 decision service tests for local holdouts (FSSDK-12369)
// One test per branch of the pseudocode in Step 3 of the ticket.
describe('local holdouts (FSSDK-12369)', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove ticket number from the title

Comment thread lib/core/decision_service/index.spec.ts Outdated
});
});

// Level 2 decision service tests for local holdouts (FSSDK-12369)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the ticket number

@raju-opti raju-opti merged commit a2b378c into master Jun 1, 2026
16 of 24 checks passed
@raju-opti raju-opti deleted the ai/mat001/FSSDK-12369-local-holdouts branch June 1, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants